package com.itheima.spring.factory;

import com.itheima.spring.service.TagService;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

/**
 * @author ：sean
 * @date ：Created in 2020/6/26
 * @description ：通过FactoryBean向容器注册组件
 * @version: 1.0
 */
@Component
public class TagServiceBean implements FactoryBean<TagService> {
	@Override
	public TagService getObject() throws Exception {
		TagService tagService = new TagService();
		System.out.println("TagServiceFactoryBean...getObject");
		return tagService;
	}

	@Override
	public Class<TagService> getObjectType() {
		return TagService.class;
	}

	@Override
	public boolean isSingleton() {
		return true;
	}
}
